As a technique similar to the people counting device, “Moving Body Detection System Using Image Sensor” disclosed in Patent Document 1 is known, for example. Patent Document 1 discloses a technique in which a motion path of a moving object is extracted from image data obtained at different time points, and the moving object is determined and counted as a person when the motion path passed through a virtual gate set on an observation image. FIG. 9 shows the technique. As shown in the drawing, when motion paths 100, 101 pass through a virtual gate 110, moving objects having moved on the motion paths 100. 101 are counted as passing people. Also, when motion paths 102, 103 pass through a virtual gate 111, moving objects having moved on the motion paths 102, 103 are counted as passing people.